//
//  GZTicketSortCell.m
//  lv678
//
//  Created by apple on 15/7/1.
//  Copyright (c) 2015年 lampshade. All rights reserved.
//  旅游票分类九宫格自定义视图

#import "GZTicketSortCell.h"
#import "GZTicketModel.h"
@interface GZTicketSortCell()
@property(nonatomic,strong)UILabel *label;
@end

@implementation GZTicketSortCell
- (instancetype)initWithFrame:(CGRect)frame{
    if (self =[super initWithFrame:frame]) {
        UILabel *lbl           = [[UILabel alloc]init];
        lbl.font               = [UIFont systemFontOfSize:12];//设置label的字体
        lbl.layer.cornerRadius = 10;//设置label为圆角
        lbl.layer.borderWidth  = 1;//设置label的边框宽度
        lbl.layer.borderColor  = [[UIColor redColor]CGColor];
        lbl.textAlignment      = NSTextAlignmentCenter;//设置label的文本居中显示
        [self.contentView addSubview:lbl];
        self.label             = lbl;
    }
    return self;
}
//重写set方法
- (void)setTicket:(GZTicketModel *)ticket{
    _ticket = ticket;
    [self setttingData];
    [self settingFrame];
}
//设置label显示的数据
- (void)setttingData{
    GZTicketModel *model = self.ticket;
    self.label.text      = model.classify;
}
//设置label的位置
- (void)settingFrame{
    CGFloat btnX = 5;
    CGFloat btnY = 5;
    CGFloat btnW = self.frame.size.width-8;
    CGFloat btnH = 30;
    self.label.frame = CGRectMake(btnX, btnY, btnW, btnH);
}

@end
